#pragma once
#include"PointIndexes.h"
#include"Triangle3D.h"
#include"Material.h"
#include"Surface.h"
#include<vector>
using namespace std;

#ifndef PI
#define PI 3.141592654f
#endif

class BaseObject
	:public Surface
{
public:
	BaseObject();
	BaseObject(Vector3 pos);
	BaseObject(Vector3 pos, Vector3 scale);
	~BaseObject();

	virtual void InitPointsAndFaces();
	virtual void UpdateTriangle();
	void UpdateMaterial();

	virtual Vector3 GetCenter();
	virtual bool Hit(lzw::Ray ray, float t0, float t1, HitRecord& rec);
	virtual BoundingBox GetBoundingBox();

	void Transform();
	void Translate();
	void Rotate();
	void Scale();
	void ClearTriangle();
public:
	Material material;
	Vector3 positon;
	Vector3 rotation;
	Vector3 scale;
	vector<Triangle3D*> triangles;
	vector<P3D> points;
	vector<PointIndexes> faces;
};

